var mainContentObject = new Vue({
    el:'#mainContent',
    data:{
        getKeyUrl:'/search/key',
        searchUrl:'/search?key=',
        key:'',
        songN:[],
        songS:[],
        songL:[],
        searching:false
    },
    methods:{
        init:function () {
            $.get(this.getKeyUrl,function (result) {
                // console.log(result.key);
                mainContentObject.key = result.key;
                mainContentObject.search();
            });
        },
        search:function () {
            var a = this.searchUrl+this.key;
            console.log('aaa: '+a);
            $.get(a,function (data) {
                console.log(data);
                mainContentObject.songN = data['name'];
                mainContentObject.songS = data['singer'];
                mainContentObject.songL = data['lyric'];
            });
        }
    },
    mounted:function () {
        this.init();
    }
});